package com.zhike.controller;

import com.zhike.service.DwsEnergyChargeWindowService;
import com.zhike.service.DwsEnergySocWindowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: zhike
 * @CreateTime: 2024/5/2
 * @Description: 能耗主题controller
 */
@RequestMapping("energy")
@RestController
public class EnergyWeekController {
    @Autowired
    private DwsEnergyChargeWindowService dwsEnergyChargeWindowService;

    @Autowired
    private DwsEnergySocWindowService dwsEnergySocWindowService;;
    /**
     * 获取最近7日各车型的充电次数
     */
    @PostMapping("getChargeCountTypeWeek")
    public String getChargeTypeWeek(@RequestBody String filter){
        return dwsEnergyChargeWindowService.getChargeTypeWeek(filter);
    }

    /**
     * 获取最近7日各品牌的充电次数
     */
    @PostMapping("getChargeCountBrandWeek")
    public String getChargeBrandWeek(@RequestBody String filter){
        return dwsEnergyChargeWindowService.getChargeBrandWeek(filter);
    }

    /**
     * 获取最近7日各车的充电次数
     */
    @PostMapping("getChargeCountWeek")
    public String getChargeWeek(@RequestBody String filter){
        return dwsEnergyChargeWindowService.getChargeWeek(filter);
    }

    /**
     * 获取每辆车最近7日的次均充电电量和时长
     */
    @PostMapping("getChargeTimeWeek")
    public String getChargeTimeWeek(@RequestBody String filter){
        return dwsEnergyChargeWindowService.getChargeTimeWeek(filter);
    }

    /**
     * 获取各车型最近7日的次均充电电量和时长
     */
    @PostMapping("getChargeTimeTypeWeek")
    public String getChargeTimeTypeWeek(@RequestBody String filter){
        return dwsEnergyChargeWindowService.getChargeTimeTypeWeek(filter);
    }

    /**
     * 获取各品牌最近7日的次均充电电量和时长
     */
    @PostMapping("getChargeTimeBrandWeek")
    public String getChargeTimeBrandWeek(@RequestBody String filter){
        return dwsEnergyChargeWindowService.getChargeTimeBrandWeek(filter);
    }

    /**
     * 获取每辆车最近7日的soc百公里平均消耗
     */
    @PostMapping("getSocWeek")
    public String getSocWeek(@RequestBody String filter){
        return dwsEnergySocWindowService.getSocWeek(filter);
    }

    /**
     * 获取各车型最近7日的soc百公里平均消耗
     */
    @PostMapping("getSocTypeWeek")
    public String getSocTypeWeek(@RequestBody String filter){
        return dwsEnergySocWindowService.getSocTypeWeek(filter);
    }

    /**
     * 获取各品牌最近7日的soc百公里平均消耗
     */
    @PostMapping("getSocBrandWeek")
    public String getSocBrandWeek(@RequestBody String filter){
        return dwsEnergySocWindowService.getSocBrandWeek(filter);
    }

    /**
     * 获取每辆车最近7日的最近百公里soc消耗
     */
    @PostMapping("getSocNearWeek")
    public String getSocNearWeek(@RequestBody String filter){
        return dwsEnergySocWindowService.getSocNearWeek(filter);
    }

    /**
     * 获取各车型最近7日的最近百公里soc消耗
     */
    @PostMapping("getSocNearTypeWeek")
    public String getSocNearTypeWeek(@RequestBody String filter){
        return dwsEnergySocWindowService.getSocNearTypeWeek(filter);
    }

    /**
     * 获取各品牌最近7日的最近百公里soc消耗
     */
    @PostMapping("getSocNearBrandWeek")
    public String getSocNearBrandWeek(@RequestBody String filter){
        return dwsEnergySocWindowService.getSocNearBrandWeek(filter);
    }



}
